<!DOCTYPE html>












  


<html class="theme-next mist use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">


  <script>
  (function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/0f81ff2f.js","daovoice")
  daovoice('init', {
      app_id: "15fc8e87"
    });
  daovoice('update');
  </script>






  
  
    
    
  <script src="/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">






















<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=6.3.0" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=6.3.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=6.3.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=6.3.0">


  <link rel="mask-icon" href="/images/logo.svg?v=6.3.0" color="#222">









<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '6.3.0',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":true,"scrollpercent":true,"onmobile":false},
    fancybox: false,
    fastclick: false,
    lazyload: false,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  




  <meta name="description" content="Maven相关的内容">
<meta name="keywords" content="项目管理,Maven,GitLab,CI">
<meta property="og:type" content="article">
<meta property="og:title" content="Maven系列（六）配合GitLab持续集成（CI）">
<meta property="og:url" content="http://blog.wangxc.club/2017/04/24/Maven系列（六）配合GitLab持续集成（CI）/index.html">
<meta property="og:site_name" content="冬与晨">
<meta property="og:description" content="Maven相关的内容">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3167229-eb185719b2acecf3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3167229-528d390e6b49b16e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3167229-02eeafb56fb336d9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3167229-52817be2fdb4bb59.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:image" content="http://upload-images.jianshu.io/upload_images/3167229-0ad768a679bbc709.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">
<meta property="og:updated_time" content="2018-06-29T13:58:50.301Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Maven系列（六）配合GitLab持续集成（CI）">
<meta name="twitter:description" content="Maven相关的内容">
<meta name="twitter:image" content="http://upload-images.jianshu.io/upload_images/3167229-eb185719b2acecf3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240">






  <link rel="canonical" href="http://blog.wangxc.club/2017/04/24/Maven系列（六）配合GitLab持续集成（CI）/">



<script type="text/javascript" id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>Maven系列（六）配合GitLab持续集成（CI） | 冬与晨</title>
  




<script async src="https://www.googletagmanager.com/gtag/js?id=UA-102769182-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-102769182-1');
</script>



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?809d5610fca8eaff344d9a698536110d";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <noscript>
  <style type="text/css">
    .use-motion .motion-element,
    .use-motion .brand,
    .use-motion .menu-item,
    .sidebar-inner,
    .use-motion .post-block,
    .use-motion .pagination,
    .use-motion .comments,
    .use-motion .post-header,
    .use-motion .post-body,
    .use-motion .collection-title { opacity: initial; }

    .use-motion .logo,
    .use-motion .site-title,
    .use-motion .site-subtitle {
      opacity: initial;
      top: initial;
    }

    .use-motion {
      .logo-line-before i { left: initial; }
      .logo-line-after i { right: initial; }
    }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband">
    </div>
<a href="https://github.com/vector4wang"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">冬与晨</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">
    <a href="/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-about">
    <a href="/about/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">
    <a href="/tags/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">
    <a href="/categories/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">
    <a href="/archives/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-commonweal">
    <a href="/404/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-heartbeat"></i> <br>公益 404</a>
  </li>

      
      
    </ul>
  

  
    

  

  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://blog.wangxc.club/2017/04/24/Maven系列（六）配合GitLab持续集成（CI）/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="wangxc">
      <meta itemprop="description" content="革命尚未成功，同志还需努力~">
      <meta itemprop="image" content="/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="冬与晨">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">Maven系列（六）配合GitLab持续集成（CI）
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">

            
            
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2017-04-24 22:31:16" itemprop="dateCreated datePublished" datetime="2017-04-24T22:31:16+08:00">2017-04-24</time>
            

            
              

              
                
                <span class="post-meta-divider">|</span>
                

                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2018-06-29 21:58:50" itemprop="dateModified" datetime="2018-06-29T21:58:50+08:00">2018-06-29</time>
              
            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/技术/" itemprop="url" rel="index"><span itemprop="name">技术</span></a></span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/2017/04/24/Maven系列（六）配合GitLab持续集成（CI）/#comments" itemprop="discussionUrl">
                  <span class="post-meta-item-text">评论数：</span> <span class="post-comments-count valine-comment-count" data-xid="/2017/04/24/Maven系列（六）配合GitLab持续集成（CI）/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>Maven相关的内容</p>
<a id="more"></a>


<h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p>想要完成接下来的操作，你要做的准备工作有以下几点：</p>
<ul>
<li><a href="http://blog.csdn.net/qqhjqs/article/details/46963495" target="_blank" rel="noopener">Maven系列（一）Maven的简介与使用</a></li>
<li><a href="http://blog.csdn.net/qqhjqs/article/details/47045585" target="_blank" rel="noopener">Maven系列（二）无Maven不项目—使用Eclipse快速搭建Maven项目 </a></li>
<li><a href="http://blog.csdn.net/qqhjqs/article/details/53495535" target="_blank" rel="noopener">Maven系列（三）Maven给不同的环境打包 </a></li>
<li><a href="http://blog.csdn.net/qqhjqs/article/details/51594583" target="_blank" rel="noopener">Maven系列（四）Maven热部署 </a></li>
<li><a href="http://blog.csdn.net/qqHJQS/article/details/52950147" target="_blank" rel="noopener">Maven系列（五）CentOS7搭建最新GitLab </a></li>
</ul>
<p>如果你没有接触过Maven，没关系，看看上面的五点，相信会让你对Maven有一个稍微深入的了解，并会让你迅速掌握其高大上的用法。</p>
<h3 id="本节所需"><a href="#本节所需" class="headerlink" title="本节所需"></a>本节所需</h3><p>先来看一下这张图：<br><img src="http://upload-images.jianshu.io/upload_images/3167229-eb185719b2acecf3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="传统与CI"><br>传统的热部署是图中虚线所指，通过本地执行<code>mvn tomcat:deploy</code> 来将项目部署到Server1上，实线所指是借助GitLab的CI来部署，比较起来感觉没什么两样，但是GitLab在这里除了作为一个代码托管平台之外，还担当着自动执行预编写脚本的功能（下面有介绍）。<br>这里需要两台Server，我用两个虚拟机来代替。</p>
<h3 id="安装GitLabRunner"><a href="#安装GitLabRunner" class="headerlink" title="安装GitLabRunner"></a>安装GitLabRunner</h3><p>可以再任意一台server安装</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">## 添加GitLab官方源</span></span><br><span class="line">curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.rpm.sh | sudo bash</span><br><span class="line"><span class="comment">## 安装</span></span><br><span class="line">sudo yum install gitlab-ci-multi-runner</span><br></pre></td></tr></table></figure>

<p>这里要在管理员的权限下执行~，过程可能有点慢。<br>安装完毕后，执行<code>gitlab-ci-multi-runner</code> 会有命令帮助提示，如下：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># gitlab-ci-multi-runner</span></span><br><span class="line">NAME:</span><br><span class="line">   gitlab-ci-multi-runner - a GitLab Runner</span><br><span class="line"></span><br><span class="line">USAGE:</span><br><span class="line">   gitlab-ci-multi-runner [global options] <span class="built_in">command</span> [<span class="built_in">command</span> options] [arguments...]</span><br><span class="line">   </span><br><span class="line">VERSION:</span><br><span class="line">   1.8.1 (a2efdd4)</span><br><span class="line">   </span><br><span class="line">AUTHOR(S):</span><br><span class="line">   Kamil Trzciński &lt;ayufan@ayufan.eu&gt; </span><br><span class="line">   </span><br><span class="line">COMMANDS:</span><br><span class="line">   <span class="built_in">exec</span>                 execute a build locally</span><br><span class="line">   list                 List all configured runners</span><br><span class="line">   run                  run multi runner service</span><br><span class="line">   register             register a new runner</span><br><span class="line">   install              install service</span><br><span class="line">   uninstall            uninstall service</span><br><span class="line">   start                start service</span><br><span class="line">   stop                 stop service</span><br><span class="line">   restart              restart service</span><br><span class="line">   status               get status of a service</span><br><span class="line">   run-single           start single runner</span><br><span class="line">   unregister           unregister specific runner</span><br><span class="line">   verify               verify all registered runners</span><br><span class="line">   artifacts-downloader download and extract build artifacts (internal)</span><br><span class="line">   artifacts-uploader   create and upload build artifacts (internal)</span><br><span class="line">   cache-archiver       create and upload cache artifacts (internal)</span><br><span class="line">   cache-extractor      download and extract cache artifacts (internal)</span><br><span class="line">   <span class="built_in">help</span>, h              Shows a list of commands or <span class="built_in">help</span> <span class="keyword">for</span> one <span class="built_in">command</span></span><br><span class="line">   </span><br><span class="line">GLOBAL OPTIONS:</span><br><span class="line">   --debug                      debug mode [<span class="variable">$DEBUG</span>]</span><br><span class="line">   --<span class="built_in">log</span>-level, -l <span class="string">"info"</span>       Log level (options: debug, info, warn, error, fatal, panic)</span><br><span class="line">   --cpuprofile                 write cpu profile to file [<span class="variable">$CPU_PROFILE</span>]</span><br><span class="line">   --<span class="built_in">help</span>, -h                   show <span class="built_in">help</span></span><br><span class="line">   --version, -v                <span class="built_in">print</span> the version</span><br></pre></td></tr></table></figure>

<h3 id="注册Runner"><a href="#注册Runner" class="headerlink" title="注册Runner"></a>注册Runner</h3><p>Runner的成功安装预示着我们现在拥有了一台发动机，下面要将“发动机”装在“机器”（GitLab）上。<br>执行<code>gitlab-ci-multi-runner register</code> 开始注册</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">[root@localhost ~]<span class="comment"># gitlab-ci-multi-runner register</span></span><br><span class="line">Running <span class="keyword">in</span> system-mode.                            </span><br><span class="line"> <span class="comment">## gitlab服务器的域名                                                  </span></span><br><span class="line">Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/):</span><br><span class="line">http://192.168.92.128</span><br><span class="line"><span class="comment">## runnerToken，下面图片有位置</span></span><br><span class="line">Please enter the gitlab-ci token <span class="keyword">for</span> this runner:</span><br><span class="line">3kjzGzK4PZDA73HYPHrP</span><br><span class="line"><span class="comment">## 描述</span></span><br><span class="line">Please enter the gitlab-ci description <span class="keyword">for</span> this runner:</span><br><span class="line">[localhost.localdomain]: 简书·<span class="built_in">test</span></span><br><span class="line">Please enter the gitlab-ci tags <span class="keyword">for</span> this runner (comma separated):</span><br><span class="line">js</span><br><span class="line">Registering runner... succeeded                     runner=3kjzGzK4</span><br><span class="line"><span class="comment">## 执行容器，我用的shell</span></span><br><span class="line">Please enter the executor: virtualbox, docker-ssh+machine, docker, docker-ssh, parallels, shell, ssh, docker+machine, kubernetes:</span><br><span class="line">shell</span><br><span class="line">Runner registered successfully. Feel free to start it, but <span class="keyword">if</span> it<span class="string">'s running already the config should be automatically reloaded!</span></span><br></pre></td></tr></table></figure>

<p><img src="http://upload-images.jianshu.io/upload_images/3167229-528d390e6b49b16e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="新版GitLab"><br>安装成功之后，gitlab的页面会多出一个<br><img src="http://upload-images.jianshu.io/upload_images/3167229-02eeafb56fb336d9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="Runner"></p>
<h3 id="添加项目"><a href="#添加项目" class="headerlink" title="添加项目"></a>添加项目</h3><p>点击Edit进入详细页面<br><img src="http://upload-images.jianshu.io/upload_images/3167229-52817be2fdb4bb59.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="详细页面"><br>我们要让“发动机”干活，就选中项目后面的enable，让项目的CI在这个Runner运行。</p>
<h3 id="编写CI脚本"><a href="#编写CI脚本" class="headerlink" title="编写CI脚本"></a>编写CI脚本</h3><p>我们要在项目的根目录下添加一个文件<code>.gitlab-ci.yml</code> ,鬼知道怎么会是酱紫的文件名。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">build:</span><br><span class="line">    script: <span class="string">"pwd &amp;&amp; mvn tomcat:deploy"</span></span><br></pre></td></tr></table></figure>

<p>这里写的比较简单，直接热部署。根据项目需要，我们可以写更复杂的脚本，比如自动将打包的项目复制到指定位置，然后解压啦、配置服务器相关环境啦，等等等，这些统统交给CI来做~，是不是很方便啊！</p>
<p>项目提交上去后自动会跑CI脚本。有执行的记录和详细信息</p>
<p><img src="http://upload-images.jianshu.io/upload_images/3167229-0ad768a679bbc709.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="集成记录"></p>
<h3 id="可能会遇到的问题"><a href="#可能会遇到的问题" class="headerlink" title="可能会遇到的问题"></a>可能会遇到的问题</h3><p>安装Runner的服务器要安装Maven<br>maven安装。</p>
<pre><code>下载maven文件，官网下载对应版本。http://maven.apache.org/download.cgi；
解压下载的包，将maven目录移动到自定义目录下，建议移动到/opt公共目录下，以便任何用户能够访问到该目录，例如/opt/apache-maven-3.3；
配置maven环境变量，修改/etc/profile，在文件末尾增加export M2_HOME=/opt/apache-maven-3.3（你的maven所在目录）， 将该目录的bin目录添加到环境变量PATH中，export PATH=$PATH:$M2_HOME/bin;
使配置生效，source /etc/profile;

测试maven安装成功，mvn -v，出现配置信息如下则说明maven配置成功：

Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)
Maven home: /Users/turinblueice/Downloads/apache-maven-3.3.3
Java version: 1.8.0_40, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: &quot;mac os x&quot;, version: &quot;10.10.5&quot;, arch: &quot;x86_64&quot;, family: &quot;mac&quot;</code></pre><h3 id="说在后面"><a href="#说在后面" class="headerlink" title="说在后面"></a>说在后面</h3><p>这篇应该是昨天晚上放在CSDN的，前前后后搞了半个多小时，后来在看其他页面的时候，一不小心给退出了，然后当时就懵逼了，真是有苦说不出！！！CSDN及时保存的功能没有简书做的好，所以我决定，以后再简书上写完，然后在复制过去<del>~</del></p>

      
    </div>

    

    
    
    

    <div>
          
            
          
    </div>

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div></div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="https://i.loli.net/2017/12/29/5a4632028eaeb.jpg" alt="wangxc 微信支付">
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="https://i.loli.net/2017/12/29/5a46320234b1d.jpg" alt="wangxc 支付宝">
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    
<div>
  
    <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">
              -------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------
        </div>
    
</div>

  
</div>
    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/项目管理/" rel="tag"><i class="fa fa-tag"></i> 项目管理</a>
          
            <a href="/tags/Maven/" rel="tag"><i class="fa fa-tag"></i> Maven</a>
          
            <a href="/tags/GitLab/" rel="tag"><i class="fa fa-tag"></i> GitLab</a>
          
            <a href="/tags/CI/" rel="tag"><i class="fa fa-tag"></i> CI</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/04/24/Spark再体验之springboot整合spark/" rel="next" title="Spark再体验之springboot整合spark">
                <i class="fa fa-chevron-left"></i> Spark再体验之springboot整合spark
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/04/24/Spark与Apache-Parquet/" rel="prev" title="Spark与Apache-Parquet">
                Spark与Apache-Parquet <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          

  
    <div class="comments" id="comments">
    </div>
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/avatar.jpg" alt="wangxc">
            
              <p class="site-author-name" itemprop="name">wangxc</p>
              <p class="site-description motion-element" itemprop="description">革命尚未成功，同志还需努力~</p>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/archives/">
                
                    <span class="site-state-item-count">83</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  <a href="/categories/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">6</span>
                    <span class="site-state-item-name">分类</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  <a href="/tags/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">124</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          

          
            <div class="links-of-author motion-element">
              
                <span class="links-of-author-item">
                  <a href="https://github.com/vector4wang" target="_blank" title="GitHub" rel="external nofollow"><i class="fa fa-fw fa-github"></i>GitHub</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="mailto:vector4wang@qq.com" target="_blank" title="E-Mail" rel="external nofollow"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="https://www.jianshu.com/u/223a1314e818" target="_blank" title="简书" rel="external nofollow"><i class="fa fa-fw fa-book"></i>简书</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="http://blog.csdn.net/qqhjqs?viewmode=contents" target="_blank" title="CSDN" rel="external nofollow"><i class="fa fa-fw fa-crosshairs"></i>CSDN</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="https://twitter.com/BMHJQS" target="_blank" title="Twitter" rel="external nofollow"><i class="fa fa-fw fa-twitter"></i>Twitter</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="https://www.facebook.com/" target="_blank" title="FB Page" rel="external nofollow"><i class="fa fa-fw fa-facebook-official"></i>FB Page</a>
                  
                </span>
              
            </div>
          

          
          

          
          

          
            
          
          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#前言"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#本节所需"><span class="nav-number">2.</span> <span class="nav-text">本节所需</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装GitLabRunner"><span class="nav-number">3.</span> <span class="nav-text">安装GitLabRunner</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#注册Runner"><span class="nav-number">4.</span> <span class="nav-text">注册Runner</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#添加项目"><span class="nav-number">5.</span> <span class="nav-text">添加项目</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#编写CI脚本"><span class="nav-number">6.</span> <span class="nav-text">编写CI脚本</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#可能会遇到的问题"><span class="nav-number">7.</span> <span class="nav-text">可能会遇到的问题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#说在后面"><span class="nav-number">8.</span> <span class="nav-text">说在后面</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      
        <div class="back-to-top">
          <i class="fa fa-arrow-up"></i>
          
            <span id="scrollpercent"><span>0</span>%</span>
          
        </div>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">wangxc</span>

  

  
</div>


  


<div class="powered-by">
<i class="fa fa-user-md"></i><span id="busuanzi_container_site_pv">
  本站访客数:<span id="busuanzi_value_site_uv"></span>
</span>
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" rel="external nofollow" href="https://hexo.io">Hexo</a> 强力驱动 v3.8.0</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" rel="external nofollow" href="https://theme-next.org">NexT.Mist</a> v6.3.0</div>




        








        
      </div>
    </footer>

    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>


























  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=6.3.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=6.3.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=6.3.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=6.3.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=6.3.0"></script>



  



	





  





  








  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  
  
  <script src="//unpkg.com/valine/dist/Valine.min.js"></script>
  
  <script type="text/javascript">
    var GUEST = ['nick','mail','link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(function (item) {
      return GUEST.indexOf(item)>-1;
    });
    new Valine({
        el: '#comments' ,
        verify: false,
        notify: false,
        appId: 'YdGFHBfuDwObik8qwCeRAWgr-gzGzoHsz',
        appKey: 'oFpbJwmMQf98DfFDUlzE5Fai',
        placeholder: 'Just go go',
        avatar:'mm',
        guest_info:guest,
        pageSize:'10' || 10,
    });
  </script>



  





  

  

  

  

  
  

  

  

  

  

  

</body>
</html>
